package macrochip.vison.com.gps.utils;

import android.os.Build;

/**
 * 手机相关工具类
 * Created by XiaoShu on 2017/11/27 0027.
 */

public class PhoneUtils {

    /**
     * 该手机是否支持硬解码
     * @return true 硬解码， false 软解码
     */
    public static boolean decode(){
        // 硬解码
        boolean hardDecoding = true;
        // 厂商
        String manufacturer = Build.MANUFACTURER.toLowerCase();
        // 型号
        String modelName = Build.MODEL.toLowerCase();

        if (manufacturer.startsWith("samsung")) {   // 三星
            // note3 都是 n900 开头
            hardDecoding = !(modelName.contains("n900")
                    || modelName.contains("g9200")
                    || modelName.contains("g9208")
                    || modelName.contains("g9209"));
        } else if (manufacturer.startsWith("motorola")) {   // 摩托罗拉
            hardDecoding = !(modelName.contains("xt1662")
                    || modelName.contains("xt1581"));
        } else if (manufacturer.startsWith("sony")) {   // 索尼

        } else if (manufacturer.startsWith("lenovo")) {     // 联想
            hardDecoding = !(modelName.contains("a3860"));
        }

        return hardDecoding;
    }
}
